package com.own.business.resource.controller.form;

import com.own.business.resource.business.form.SignatureCommonForm;
import com.own.component.common.exception.BusinessSimpleException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * SignatureForm
 *
 * @author chenxueli
 * @date 2024-01-02 14:03:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SignatureForm extends SignatureCommonForm implements Serializable {

    @Schema(title = "模块名")
    private String module;

    @Schema(title = "标号")
    private String sign;

    public void check() {
        super.check();
        if (StringUtils.isBlank(module)) {
            throw new BusinessSimpleException("模块名不能为空");
        }
        if (StringUtils.isBlank(sign)) {
            throw new BusinessSimpleException("标号不能为空");
        }
    }

}
